/**
 * maxtime.cpp is part of Gedule.
 *
 * Gedule is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gedule is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Gedule.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "maxtime.h"
#include "../../../utils/visitor/visitor.h"
#include <sstream>

const std::string MaxTime::MAX_TIME_CONSTRAINT = "Max time";

///////////////////////////////////////////////////////////////
MaxTime::MaxTime( tTime a_maxTime ) :
    ModelConstraint(),
    m_maxTime( a_maxTime )
{
}

///////////////////////////////////////////////////////////////
MaxTime::~MaxTime()
{
}

///////////////////////////////////////////////////////////////
void MaxTime::Accept( Visitor * a_visitor, bool )
{
    if( a_visitor )
        a_visitor->Visit( this );
}

///////////////////////////////////////////////////////////////
std::string MaxTime::Print() const
{
    std::ostringstream strStream;
    strStream << MAX_TIME_CONSTRAINT << " = " << m_maxTime;

    return strStream.str();
}

///////////////////////////////////////////////////////////////
tTime MaxTime::GetMaxTime() const
{
    return m_maxTime;
}

///////////////////////////////////////////////////////////////
void MaxTime::SetMaxTime( tTime a_maxTime )
{
    m_maxTime = a_maxTime;
}
